package com.nai365.nart.common.base.controller;


import com.nai365.nart.common.base.service.FileService;
import com.nai365.nart.common.core.util.R;
import com.nai365.nart.common.security.annotation.Inner;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@AllArgsConstructor
@RequestMapping("/upload" )
@Api(value = "upload", tags = "文件上传管理")
public class FileUploadController {
	FileService fileService;
	@PostMapping(value = "/single")
	@Inner(value = false)
	public R upload(@RequestPart("file") MultipartFile file) {
		return fileService.uploadFile(file);
	}




}
